home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr34 / outoff.zip / OLOOP.BAT < prev    next >
DOS Batch File  |  1993-02-14  |  4KB  |  122 lines

  1. @echo off
  2. echo **********************************************************************
  3. echo ***                                                                ***
  4. echo ***                SAMPLE CC:MAIL ROUTER BATCH FILE                ***
  5. echo ***                                                                ***
  6. echo ***             THIS FILE WLIL NOT WORK WITHOUT EDITING.           ***
  7. echo ***                                                                ***
  8. rem  ***                                                                ***
  9. rem  ***  Please look at the comments below for directions for editing  ***
  10. rem  ***  this file.  Also, remember that this file may not suit your   ***
  11. rem  ***  needs; use it as an example of how to integrate Out of the    ***
  12. rem  ***  Office into your existing cc:Mail installation.               ***
  13. rem  ***  v1.00                                                         ***
  14. echo **********************************************************************
  15.  
  16.  
  17. rem ****************** STEP I: CONFIGURE THE ENVIRONMENT ******************
  18.  
  19. rem *** Edit the Mail Administrator.  This person will receive mail when
  20. rem *** there is an error.
  21.  
  22. set MAIL_ADMINISTRATOR=David Potter
  23.  
  24.  
  25.  
  26. rem *** Do other one-time things here.
  27.  
  28.  
  29.  
  30. rem *** If you own Cobblestone Software's MAIL2 program, put it in this
  31. rem *** directory.
  32.  
  33. if exist MAIL2.EXE echo cc:Mail Router Batch File started. > office.tlk
  34. if exist MAIL2.EXE MAIL2 office.tlk %MAIL_ADMINISTRATOR /text /from Out of the Office
  35. if exist office.tlk del office.tlk
  36.  
  37.  
  38.  
  39.  
  40. rem ********************** STEP II: TOP OF THE LOOP ***********************
  41. :mainloop
  42.  
  43. rem *** IF YOU DO NOT USE ROUTER OR GATEWAY....
  44. rem *** Then just use this command: WAIT <number of seconds to wait>
  45. rem *** (uncomment the next line for 15 minutes)
  46. rem *** WAIT 6300
  47.  
  48. rem *** IF YOU DO USE ROUTER OR GATEWAY....
  49. rem *** Put your cc:Mail ROUTER.EXE (or GATEWAY.EXE) command line here.
  50. rem *** Be sure to include the END/xxM flag on the command line.
  51. rem *** (Example: END/15M will cause ROUTER to quit after fifteen minutes).
  52. rem ***
  53. rem *** The idea here is to have your batch file loop every x minutes.
  54.  
  55. ROUTER M:\CCDATA com1 2400 END/15M
  56.  
  57.  
  58. rem *** Now we run Out of the Office
  59.  
  60. OFFICE
  61. if errorlevel == 0 goto officefini
  62. rem *** There was an error
  63. if NOT EXIST MAIL2.EXE goto officefini
  64. rem *** There was an error, but I have MAIL2.
  65.  
  66. if errorlevel == 2 goto nocfgfile
  67. if errorlevel == 3 goto exportexists
  68. if errorlevel == 4 goto missingfile
  69.  
  70. goto unknown
  71.  
  72. :nocfgfile
  73. echo Out of the Office cannot find the configuration file. > office.tlk
  74. echo Processing halted. >> office.tlk
  75. mail2 %MAIL_ADMINISTRATOR office.tlk /text /from Out of the Office
  76. del office.tlk
  77. goto officefini
  78.  
  79. :exportexists
  80. echo Out of the Office halted because the export file existed > office.tlk
  81. echo on startup.  This usually indicated that Out of the Office >> office.tlk
  82. echo crashed last time it ran. >> office.tlk
  83. echo Processing halted. >> office.tlk
  84. mail2 %MAIL_ADMINISTRATOR office.tlk /text /from Out of the Office
  85. del office.tlk
  86. goto officefini
  87.  
  88. :missingfile
  89. echo Out of the Office halted because it cannot find CHKSTAT.EXE, > office.tlk
  90. echo IMPORT.EXE, or EXPORT.EXE >> office.tlk
  91. echo Processing halted. >> office.tlk
  92. mail2 %MAIL_ADMINISTRATOR office.tlk /text /from Out of the Office
  93. del office.tlk
  94. goto officefini
  95.  
  96. :unknown
  97. echo Out of the Office halted for an unknown reason. > office.tlk
  98. echo (This indicates errorlevel was not 0-4) >> office.tlk
  99. echo Please check the Out of the Office server. >> office.tlk
  100. echo Processing halted. >> office.tlk
  101. mail2 %MAIL_ADMINISTRATOR office.tlk /text /from Out of the Office
  102. del office.tlk
  103.  
  104. :officefini
  105.  
  106. rem **************** STEP III - MIDDLE OF THE LOOP **************************
  107.  
  108. rem *** Put whatever other commands you want to execute regularly in here
  109.  
  110. if exist OFFICE.UND if exist MAIL2.EXE mail2 office.und %MAIL_ADMINISTRATOR /text /from OFFICE UNDELIVERABLE FILE
  111. if exist OFFICE.UND if exist MAIL2.EXE if NOT exist CCMAIL.UND del office.und
  112.  
  113.  
  114. rem **************** STEP IV - BOTTOM OF THE LOOP **************************
  115.  
  116. goto mainloop
  117.  
  118.  
  119.  
  120.  
  121.  
  122.